# 环境变量
import re

# 相关配置字段
WORKSPACE = 'workspace'  #db文件保存路径
OUTPUT_SPACE = 'output'  #输出文件保存路径
TIME_THRESHOLD = 10 #超时标红阈值
DEFAULT_COL_WIDTH = 15 #默认xlsx列宽
NS_TO_MS = 1000000  #纳秒到微妙转换

# 正则配置
PATTERN_FRAME_TRACE_RELATE = re.compile('\\[[0-9, ]*\\]')

# 冷启动对应6个阶段
LIFE_CYCLE_NAME_PROCESS_CREATING = "Process Creating"
LIFE_CYCLE_NAME_APPLICATION_LAUNCHING = "Application Launching"
LIFE_CYCLE_NAME_UI_ABILITY_LAUNCH = "UI Ability Launching"
LIFE_CYCLE_NAME_UI_ABILITY_ON_FOREGROUND = "UI Ability onForeground"
LIFE_CYCLE_NAME_FIRST_APP_FRAME_RENDERING = "First Frame - App Phase"
LIFE_CYCLE_NAME_FIRST_RS_FRAME_RENDERING = "First Frame - Render Phase"

# 冷启动阶段对应的打点阶段
TRACE_START_ABILITY = 'H:virtual int OHOS::AAFwk::AbilityManagerService::StartAbility('
TRACE_START_ABILITY_LOCKED = 'H:int OHOS::AAFwk::MissionListManager::StartAbilityLocked'
TRACE_LOAD_ABILITY = 'H:virtual void OHOS::AppExecFwk::AppMgrServiceInner::LoadAbility'
TRACE_ATTACH_APPLICATION = 'H:virtual void OHOS::AppExecFwk::AppMgrServiceInner::AttachApplication'
TRACE_LAUNCH_ABILITY = 'H:void OHOS::AppExecFwk::MainThread::HandleLaunchAbility'
TRACE_FOREGROUND_ABILITY = 'HandleAbilityTransaction'
TRACE_RECEIVE_VSYNC = 'H:ReceiveVsync'
TRACE_APP_RENDERING = 'H:MarshRSTransactionData'
TRACE_RS_RENDERING = 'H:RSMainThread::ProcessCommandUni'
PROCESS_RENDER_SERVICE = 'render_service'

# 冷启动结束打点trace
COLD_START_FINISH_SIGN = "H:CustomNode:BuildItem [FalconComponent]["